﻿@{Htss.Platform.Web.HtmlHelper Html = new Htss.Platform.Web.HtmlHelper();}
<div class="navigation-bar block">
    <div class="navigation-bar-content container offset3">
        <a href="/" class="element"><span class="icon-grid-view">布云谷</span></a>
        <span class="element-divider"></span>
        <a class="element1 pull-menu" href="#"></a>
        <a class="element" href="/">首页</a>
        <a class="element" href="/posts/list">有云</a>
        <a class="element" href="/u">谷友</a>
        
        @if (Html.Session["UserID"] == null)
        {
            <a href="/login" class="element offset7">登录</a>
            <a href="/register" class="element">注册</a>
        }
        else
        {
            <div class="element offset7" id="dropdownMain" onmouseover="ShowHidden(1)" onmouseout="ShowHidden(0)">
                <a class="dropdown-toggle" href="#">
                    @(Html.Session["UserName"].ToString())<strong class="caret"></strong>
                </a>
                <ul class="dropdown-menu place-right" id="dropdownMenu">
                   
                    <li>
                        <a href="/posts/add">发布有云</a>
                    </li>
                    <li>
                        <a href="/user/posts">我的有云</a>
                    </li>
                    <li class="divider"></li>
                    <li>
                        <a href="/user/info">个人设置</a>
                    </li>
                    <li>
                        <a href="/user/friends">好友管理</a>
                    </li>
                    <li>
                        <a href="JavaScript:LoginOut()">退出登录</a>
                    </li>
                </ul>
            </div>
            <script type="text/javascript">
                function LoginOut() {
                    if (confirm('确认退出登录吗?')) {
                        window.location.href = '/loginout';
                    }
                }
                function ShowHidden(t) {
                    if (t == 0) {
                        $("#dropdownMenu").hide();
                    }
                    else {
                        $("#dropdownMenu").show();
                    }
                }
            </script>
        }
    </div>
</div>
